package org.example.mapper;

import org.example.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {
    User findByUserName(String username);
    //添加
    void add(String username, String password);
    void update(User user);
    void updatePwd(String md5String, Integer id);
    // 分页查询用户列表
    List<User> selectUserPage(Map<String, Object> params);
    // 统计用户总数
    int selectUserCount(String nickName);
    //根据用户名查询用户
/*    @Select("select * from user where username=#{username}")
    User findByUserName(String username);

    //添加
    @Insert("insert into user(username,password)" +
            " values(#{username},#{password})")
    void add(String username, String password);

    @Update("update user set nickname=#{nickname} where id=#{id}")
    void update(User user);

    @Update("update user set password=#{md5String} where id=#{id}")
    void updatePwd(String md5String, Integer id);*/
}
